<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../datepicker/jquery-ui.min.css">
    <link type="text/css" rel="stylesheet" href="../css/app.css"/>
    <link type="text/css" rel="stylesheet" href="../css/loginMobile.css"/>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script src="../datepicker/jquery-ui.min.js"></script>
    <script type="text/javascript" src="/h5/js/all.js"></script>
    <link type="text/css" rel="stylesheet" href="../css/all.css"/>
</head>
<body id="Ibody">
<!-----------工厂环境页面---------->
<div class="stepTwo" id="IstepNineFactoryEnvirenment">
    <div class="companyHeadPanel">
        <div class="companyHeadOne">您工厂成本明细表</div>
    </div>
    <div id="costlist">

    </div>
     <div class="nextStepDiv">
        <span class="prevStep" onclick="history.go(-1)">返回</span>
        <span class="nextStep" onclick="setSave()">保存</span>
    </div>
</div>
<span id="count"></span>
<!-----------工厂成本表---------->





<!-----------提示信息---------->
<div id="errMsg"></div>
<!-----------提示信息---------->
</body>
<style>
    #costlist .inputDiv{
        width: 3.5rem;
    }
    #costlist .sizedivbtn {
       text-align: center;
        margin-top: 0.5rem;
    }
</style>
<script>
        H5.TitleBar.create("成本明细表")
   var Table=new MC.Order.Table($('#costlist'));
   Table.hangText=false;
   Table.lieText='自定义成本标题';
   Table.init();
    var id='';
   MC.apiD("getcostlist",{type:'gc'},function(data){
       id=data.id;
       console.log(data);
       let costlist=data.costlist;
       if(costlist&&costlist!==''){
           Table.setData(costlist);
       }else{
           Table.sethang('数值');
           Table.setlie('房租,水电,税收,生活费,裁剪,缝制,检验,打眼钉扣,整烫,包装,货运,设备折旧,耗材损耗');
       }
       Table.create();
   });

   function setSave(){
       var data=Table.getDataJson();
       MC.apiD("setcostlist",{id:id,costlist:data},function(){
           MC.msg.show("保存成功");
       });
   }


    /*
    MC.View.pic.load();
    ///api/member/factory/fac-env-upload
    function setSave(){
        var envs=[];
        var list=[];
        list['envs']={};
        var postsavelist=$('[postsave=envs]');
        for(var i=0;i<postsavelist.length;i++){
            var obj={};
            var one=$(postsavelist[i]);
            list['envs'][one.attr('id')]=(one.val());
        }
        MC.apiD('/api/member/factory/fac-env-upload',{
            envs:JSON.stringify(list['envs']),
            type:'gc'
        },function(){
            MC.msg.show('保存成功');
        });
    }


*/


</script>
</html>